﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2-10.aspx.cs" Inherits="Example.WebForm2_10" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>模式匹配验证示例</title>
</head>
<body>
    <form id="form1" runat="server">
     模式匹配验证示例<hr />
    <div>
      电子邮箱：<asp:TextBox ID="txtEmail" runat="server" />
    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
        ControlToValidate="txtEmail" ErrorMessage="邮箱格式不正确！" 
        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
    </asp:RegularExpressionValidator>
    <asp:Button ID="btnCmf" runat="server" Text="确定" />    

    </div>
    </form>
</body>
</html>
